package com.vgemv.jsutilitysdk.Menu.JsMenuView.List;

import com.vgemv.jsutilitysdk.Menu.JsMenuView.JsMenuItemModelDefault;
import com.vgemv.jsutilitysdk.Menu.JsMenuView.JsMenuItemStyleDefault;
import com.vgemv.jsutilitysdk.Menu.JsMenuView.JsMenuItemVm.JsMenuItemVm;

public class JsListItemVm extends JsMenuItemVm {

        public int height;
        public Class cls;

        public JsListItemVm(int index, String title, String description,Class cls) {
            super(1);
            this.cls = cls;
            JsMenuItemModelDefault model = new JsMenuItemModelDefault(index,title,description,null);
            setModelForState(0,model);
            calculateHeight();
        }
    public JsListItemVm(int index, String title, String description) {
        super(1);
        JsMenuItemModelDefault model = new JsMenuItemModelDefault(index,title,description,null);
        setModelForState(0,model);
        calculateHeight();
    }

        private void calculateHeight() {
            JsMenuItemModelDefault model = (JsMenuItemModelDefault)currentModel();
            if(model.mStr_detail.length()<=30) {
                height = 200;
            }
            else {
                height = 400;
            }
        }
}
